home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Views / Tiled Views / RuledPaneRowOfWidth.h < prev    next >
Text File  |  2000-06-23  |  868b  |  42 lines

  1. // RuledPaneRowOfWidth.h
  2.  
  3. #ifndef RuledPaneRowOfWidth_h
  4. #define RuledPaneRowOfWidth_h
  5.  
  6. #ifndef PaneRowOfWidth_h
  7. #include "PaneRowOfWidth.h"
  8. #endif
  9. #ifndef ViewCell_h
  10. #include "ViewCell.h"
  11. #endif
  12. #ifndef VerticalBar_h
  13. #include "VerticalBar.h"
  14. #endif
  15.  
  16. template <uint32 nonRulePanes>
  17. class RuledPaneRowOfWidth: public PaneRowOfWidth< 2 * nonRulePanes - 1 >
  18.   {
  19.     public:
  20.         RuledPaneRowOfWidth()
  21.           {
  22.             static const VerticalBar<1> verticalLine;
  23.             for ( uint32 i = 1; i < 2 * nonRulePanes - 1; i+=2 )
  24.               {
  25.                 PaneRowOfWidth::operator[](i).SetContent( ViewCell::Black() );
  26.                 PaneRowOfWidth::operator[](i).SetSizer( verticalLine );
  27.               }
  28.           }
  29.         
  30.         RectangularPane& operator[]( uint32 i )
  31.           {
  32.             return PaneRowOfWidth::operator[]( 2*i );
  33.           }
  34.         
  35.         RectangularPane& operator[]( uint32 i ) const
  36.           {
  37.             return PaneRowOfWidth::operator[]( 2*i );
  38.           }
  39.   };
  40.  
  41. #endif
  42.